<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>思客多-商户登录</title>
    <meta name='description' content='思客多微商城小程序系统国内领先的微信公众平台开发服务商，提供微信商城、微信小程序、餐饮O2O、移动办公、智慧城市等一体化微信营销解决方案。'>
    <meta name='keywords' content='思客多,微信营销,微信商城,微信分销系统,微信定制开发,餐饮O2O,微网站,微商城,微营销,微信公众平台,微信小程序商城系统'>
    <link rel="stylesheet" href="{__ADMIN_PATH}/login/assets/css/index.css">
    <link rel="stylesheet" href="{__ADMIN_PATH}/login/assets/css/swiper.min.css">
    <script src="{__ADMIN_PATH}/login/assets/js/swiper.min.js"></script>
    <style>
        .swiper-pagination-bullet-active{
            width: 20px;
            border-radius: 10px;
        }
    </style>
</head>
<body>
<div class="header">
    <div class="h-box">
        <img src="{__ADMIN_PATH}/login/assets/img/logo.png" alt="">
        <div class="phone">
            <span class="icon"></span>
            <p>24小时服务电话：400-6809-711</p>
        </div>
    </div>
</div>
<div class="content">
    <div class="c-login">
        <div class="c-login-banner">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide"><img src="{__ADMIN_PATH}/login/assets/img/loginBg.png"/></div>
                    <div class="swiper-slide"><img src="{__ADMIN_PATH}/login/assets/img/registerBg.png"></div>
                    <div class="swiper-slide"><img src="{__ADMIN_PATH}/login/assets/img/forgetBg.png"></div>
                </div>
                <!-- 如果需要分页器 -->
                <div class="swiper-pagination"></div>
            </div>
        </div>
        <div class="c-login-box">
            <div class="b-tab forgetPsd-title">
                <!-- <span>商户登录</span> -->
                <span class="active">忘记密码</span>
            </div>
            <div class="b-input">
                <p>
                    <span class="icon icon-phone"></span>
                    <input  id="account" type="text" placeholder="手机号码">
                </p>
            </div>
            <div class="b-input">
                <p>
                    <span class="icon icon-psd"></span>
                    <input id="pwd" type="text" placeholder="新密码">
                </p>
            </div>
            <div class="b-input sendCode">
                <p>
                    <span class="icon icon-code"></span>
                    <input id="verify" type="text" placeholder="验证码">
                    <input  type="button" id="getcode" value="发送验证码" onclick="daojishi(60)">
                </p>
            </div>
            <div class="b-btn">
                <button onclick="do_password()">提交</button>
            </div>
            <div class="b-tip">返回登陆</div>
        </div>
    </div>
    <div class="c-record">COPYRIGHT  2013-2020 成都思软科技有限公司 蜀ICP备18038959号</div>
</div>
<!-- 全局js -->
<script src="{__PLUG_PATH}jquery-1.10.2.min.js"></script>
<script src="{__FRAME_PATH}js/bootstrap.min.js?v=3.4.0"></script>
<script src="{__PLUG_PATH}layui/layui.all.js"></script>
<!--统计代码，可删除-->
<!--点击刷新验证码-->
<script>
    function daojishi(t) {
        var account = $('#account').val();
        if (!account) return layer.msg('请输入手机号码');
        if(account.length!=11){
            return layer.msg('手机号码有误');
        }
        var url = "{:url('send_msg_forget')}";
        $.ajax({
            url: url,
            data: {
                account: account,
            },
            type: 'post',
            dataType: 'json',
            success: function (rem) {
                if (rem.code == 200 || rem.status == 200) {
                    layer.msg(rem.msg);
                    var intv = setInterval( function(){
                        t--;
                        if( t > 0 )
                        {
                            $("#getcode").attr('disabled', 'disabled');
                            $("#getcode").val( t +'秒获取');
                        }
                        else
                        {
                            $("#getcode").attr('disabled', false );
                            $("#getcode").val( '获取验证码');
                            clearInterval(intv);
                        }
                    }, 1000);
                } else {
                    layer.msg(rem.msg);
                    return false;
                }
            },
            error: function (err) {
                layer.msg('系统错误');
                return false;
            }
        });
    }
    function do_password() {
        var account = $('#account').val(), pwd = $('#pwd').val(), verify = $('#verify').val();
        if (!account) return layer.msg('请输入手机号码');
        if(account.length!=11){
            return layer.msg('手机号码有误');
        }
        if (!pwd) return layer.msg('请输入新密码');
        var url = "{:url('forget_password')}";
        $.ajax({
            url: url,
            data: {
                account: account,
                pwd: pwd,
                verify: verify,
            },
            type: 'post',
            dataType: 'json',
            success: function (rem) {
                if (rem.code == 200 || rem.status == 200) {
                    layer.msg(rem.msg);
                    setTimeout(function () {
                        window.location.href = rem.data.url;
                    },1000)
                } else {
                    layer.msg(rem.msg);
                }
            },
            error: function (err) {
                layer.msg('系统错误');
            }
        });
        return false;
    }
</script>
<script>
    $(function(){
        $('.b-tip').click(() => {
            window.location.href = "{:url('login/index')}"
        })
        var mySwiper = new Swiper ('.swiper-container', {
            // 轮播图的方向，也可以是vertical方向
            direction:'horizontal',
            //播放速度
            loop: true,
            // 自动播放时间
            autoplay:{
                disableOnInteraction: false,
                delay: 2000,
            },
            // 播放的速度
            speed:2000,
            // 如果需要分页器，即下面的小圆点
            pagination: {
                el: '.swiper-pagination',
            },
        });
    })
</script>
</body>
</html>